import request from '@/utils/request'

const fetchCates = (params = {}) => (
  request.get('/cateLists', { params })
)

const updateCate = (params = {}) => (
  request.put('/updateCate', params)
)

const delCate = id => (
  request.delete('/delCate', { params: { id } })
)

const addCate = (params = {}) => (
  request.post('/addCate', params)
)

const fetchCateDetail = id => (
  request.get('/fetchCateDetail', { params: { id } })
)
export {
  fetchCates,
  updateCate,
  delCate,
  addCate,
  fetchCateDetail
}
